﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage2.master" AutoEventWireup="true" CodeFile="Admin_XemDanhSachPhanLoai.aspx.cs" Inherits="ChucNang_Admin_Admin_XemDanhSachPhanLoai" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2"  ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h1>Danh Sách Loại Sản Phẩm</h1>
    <script type="text/javascript" language="javascript">
    var xmlhttp;
    var idcontent;
    function GetXmlHttpObject()
    {
	    if (window.XMLHttpRequest)
	    {
		    // code for IE7+, Firefox, Chrome, Opera, Safari
		    return new XMLHttpRequest();
	    }
	    if (window.ActiveXObject)
	    {
		    // code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    return null;
    } 
    function LoadDefault(iddiv,idcha) 
    {
        idcontent=iddiv;
        xmlhttp = GetXmlHttpObject();
	    if (xmlhttp==null)
	    {
		    alert ("Your browser does not support XML HTTP Request");
		    return;
	    }
        if(idcha==0)
        {
            var url="Admin_XuLyHienThiDanhSachPhanLoai.aspx?Id_Cha=" + idcha;		
	        xmlhttp.onreadystatechange=StateChange ;	
	        xmlhttp.open("GET",url,true);
	        xmlhttp.send(null);
	        return;       
            
        }
        else
        {
            btn = document.getElementById(idcha);
            div = document.getElementById("childof"+ idcha);
            //idcontent=iddiv;
        
	   
	        if(btn.value=="-")
	        {
	            div.innerHTML="";
	            btn.value="+";
	        }
	        else
	        {
	            var url="Admin_XuLyHienThiDanhSachPhanLoai.aspx?Id_Cha=" + idcha;		
	            xmlhttp.onreadystatechange=StateChange ;	
	            xmlhttp.open("GET",url,true);
	            xmlhttp.send(null);
	            btn.value="-";
	        }
	    }
        
    }
    function StateChange()
    {
        if (xmlhttp.readyState==4)
	    {
	        document.getElementById(idcontent).innerHTML=xmlhttp.responseText;
	    }
    
    }
     
    </script>
    <%Response.Write("<script>Onload=LoadDefault('content',0)</script>");%>
    <div >
        <asp:Button ID="btnThem" runat="server" Text="Thêm" onclick="btnThem_Click" />
        <div id="content">
        </div>
       
    </div>
    
</asp:Content>

